package belf.migrate.engine.ddl.seq.oracle;

import belf.migrate.api.model.QualifiersModel;
import belf.migrate.api.table.schema.Catalog;
import belf.migrate.engine.ddl.BaseDDLConvert;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Oracle2DMSeqConvert extends BaseDDLConvert {
    public Oracle2DMSeqConvert(String objectName, String sql, Catalog sourceCatalog, Catalog sinkCatalog,
                               String schema, QualifiersModel qualifiersModel) {
        super(objectName, sql, sourceCatalog, sinkCatalog, schema, qualifiersModel);
    }

    @Override
    public String convert() {
        Pattern pattern = Pattern.compile("\\sEDITIONABLE\\s", Pattern.CASE_INSENSITIVE);
        Matcher matcher = pattern.matcher(sql);
        String result = matcher.replaceAll(" ");
        return result;
    }
}
